(function () { "use strict";
var AppServer = function() {
	this.initBDD();
	this.initApp();
	this.initHTTP();
	this.initSocket();
};
AppServer.__name__ = true;
AppServer.main = function() {
	AppServer.instance = new AppServer();
}
AppServer.prototype = {
	cb_connect: function(err) {
		if(err == null) console.log("[AppServer]::start >> connection réussie avec la base de données"); else console.log("ERROR [AppServer]::start >> erreur lors de la connection à la base de données : " + err);
	}
	,cb_handle: function(req,res) {
		res.render("ok");
	}
	,initSocket: function() {
	}
	,initHTTP: function() {
		this.server = (Http__15||require("http")).createServer(this.app);
		this.server.listen(8080);
	}
	,initApp: function() {
		this.app = new (Express__12||require("express"))();
		this.app.get("*",$bind(this,this.cb_handle));
	}
	,initBDD: function() {
		this.db = (Mongoose__22||require("mongoose"))._.connect("mongodb://localhost/BMP/",$bind(this,this.cb_connect));
	}
	,__class__: AppServer
}
var EReg = function(r,opt) {
	opt = opt.split("u").join("");
	this.r = new RegExp(r,opt);
};
EReg.__name__ = true;
EReg.prototype = {
	__class__: EReg
}
var js = {}
js.Boot = function() { }
js.Boot.__name__ = true;
js.Boot.__interfLoop = function(cc,cl) {
	if(cc == null) return false;
	if(cc == cl) return true;
	var intf = cc.__interfaces__;
	if(intf != null) {
		var _g1 = 0, _g = intf.length;
		while(_g1 < _g) {
			var i = _g1++;
			var i1 = intf[i];
			if(i1 == cl || js.Boot.__interfLoop(i1,cl)) return true;
		}
	}
	return js.Boot.__interfLoop(cc.__super__,cl);
}
js.Boot.__instanceof = function(o,cl) {
	if(cl == null) return false;
	switch(cl) {
	case Int:
		return (o|0) === o;
	case Float:
		return typeof(o) == "number";
	case Bool:
		return typeof(o) == "boolean";
	case String:
		return typeof(o) == "string";
	case Dynamic:
		return true;
	default:
		if(o != null) {
			if(typeof(cl) == "function") {
				if(o instanceof cl) {
					if(cl == Array) return o.__enum__ == null;
					return true;
				}
				if(js.Boot.__interfLoop(o.__class__,cl)) return true;
			}
		} else return false;
		if(cl == Class && o.__name__ != null) return true;
		if(cl == Enum && o.__ename__ != null) return true;
		return o.__enum__ == cl;
	}
}
js.npm = {}
js.npm.connect = {}
js.npm.connect.support = {}
js.npm.connect.support._Middleware = {}
js.npm.connect.support._Middleware.Middleware_Impl_ = function() { }
js.npm.connect.support._Middleware.Middleware_Impl_.__name__ = true;
js.npm.connect.support._Middleware.Middleware_Impl_.fromMiddleware = function(middleware) {
	return middleware;
}
js.npm.connect.support._Middleware.Middleware_Impl_.fromAsync = function(method) {
	return method;
}
js.npm.connect.support._Middleware.Middleware_Impl_.fromSync = function(method) {
	return method;
}
js.npm.mongoose = {}
js.npm.mongoose.Promise = function() { }
js.npm.mongoose.Promise.__name__ = true;
js.support = {}
js.support._RegExp = {}
js.support._RegExp.RegExp_Impl_ = function() { }
js.support._RegExp.RegExp_Impl_.__name__ = true;
js.support._RegExp.RegExp_Impl_.fromEReg = function(r) {
	return r.r;
}
js.support._RegExp.RegExp_Impl_.toEReg = function(r) {
	return new EReg(r.source,(r.ignoreCase?"i":"") + (r.global?"g":"") + (r.multiline?"m":""));
}
var $_, $fid = 0;
function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $fid++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; o.hx__closures__[m.__id__] = f; } return f; };
String.prototype.__class__ = String;
String.__name__ = true;
Array.prototype.__class__ = Array;
Array.__name__ = true;
var Int = { __name__ : ["Int"]};
var Dynamic = { __name__ : ["Dynamic"]};
var Float = Number;
Float.__name__ = ["Float"];
var Bool = Boolean;
Bool.__ename__ = ["Bool"];
var Class = { __name__ : ["Class"]};
var Enum = { };
var Crypto__17 = require("crypto");
var EventEmitter__4 = require("events").EventEmitter;
var Http__15 = require("http");
var Net__20 = require("net");
var Url__18 = require("url");
var Agent__16 = require("http").Agent;
var ClientRequest__11 = require("http").ClientRequest;
var Server__14 = require("http").Server;
var Writable__6 = require("stream").Writable;
var ServerResponse__10 = require("http").ServerResponse;
var Server__21 = require("net").Server;
var Socket__19 = require("net").Socket;
var Readable__5 = require("stream").Readable;
var Connect__13 = require("connect");
var Express__12 = require("express");
var Mongoose__22 = require("mongoose");
(Mongoose__22||require("mongoose"))._ = (Mongoose__22||require("mongoose"));
var Connection__9 = require("mongoose").Connection;
var Document__7 = require("mongoose").Document;
var Model__8 = require("mongoose").Model;
var Mongoose__0 = require("mongoose").Mongoose;
var Schema__1 = require("mongoose").Schema;
var SchemaType__3 = require("mongoose").SchemaType;
var VirtualType__2 = require("mongoose").VirtualType;
AppServer.HOST_BDD = "mongodb://localhost/BMP/";
AppServer.PORT = 8080;
AppServer.main();
})();
